<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Jquery【MVP设计模式】</title>
		<script type="text/javascript" src="../jquery.min.js" ></script>
	</head>
	<body>
		<div> 
			<img src="../img/day02.png" width="500px" height="500px"/>
			<br/>
			<input type = "text" id = "ipt" />
			<button id = "btn">提交</button>
			<ul id = "list"></ul>
		</div>
	</body>
	<script>
		 function Page(){}
		 $.extend(Page.prototype, {
		 	init : function(){
		 		this.bindEvents()
		 	},
		 	bindEvents : function (){
		 		var btn = $("#btn");
		 		btn.on('click',$.proxy(this.handleBtnClick,this))
		 	},
		 	handleBtnClick : function(){
		 		var inputElem = $("#ipt");
		 		var inputValue = inputElem.val();
		 		if(inputValue != ""){
			 		var ulElem = $("#list");
			 		ulElem.append('<li>' + inputValue + '</li>');
		 		}
		 		inputElem.val('');
		 	}
		});
		 	
	 	var page = new Page();
	 	page.init();
	</script>
</html>
